
interface Flying
{
    void fly();
}
interface Swiming
{
    public abstract void swim();
}
interface Running
{
    void run();
}
class Animal
{
    int age;
    String name;
    public Animal(String name,int age)
    {
        this.name=name;
        this.age=age;
    }


    public void eat()
    {
        System.out.println("动物吃饭");
    }

}
 class Dog extends Animal implements Swiming
{

    //String name;
    public Dog(String name,int age)
    {
        super(name,age);
    }
    public void swim()
    {
        System.out.println(name+"正在游泳");
    }


}
class  Bird extends Animal implements Flying
{
    public Bird(String name,int age)
    {
        super(name,age);
    }
    //String name;
    public void fly()
    {
        System.out.println(name+"正在飞");
    }


}
class Fish  extends Animal implements Running
{
    public Fish(String name,int age)
    {
        super(name,age);
    }
    //String name;
    public void run()
    {
        System.out.println(name+"正在跑");
    }
}
public class text
{
    public static void main(String[] args) {
       Dog dog=new Dog("wang",7);
       Fish fish=new Fish("li",8);
      Bird bird=new Bird("xiao",9);
        dog.swim();
        bird.fly();
        fish.run();



    }

}









